package com.azzcs.juc.product_consumer;

/**
 * @Author: wzg
 * @Date: 2021/6/15 下午2:15
 */
public class C implements Runnable {

    private Q q;
    private String name;

    public C(Q q, String name) {
        this.q = q;
        this.name = name;
    }

    @Override
    public void run() {
        while (true){
            String result  = q.get();
            System.out.println("consumer "+name+":"+result);
        }
    }
}
